#include<iostream>
#include<string>
#include<set>
#include<cstring>
#include<vector>
using namespace std;
typedef long long LL;
const int N = 3e3 + 10;
int st[N][N];
LL f[N][N];
int n, m, k;
int main()
{
	cin >> n >> m >> k;
	while (k--) {
		int a, b;
		cin >> a >> b;
		st[a][b] = 1;
	}
	LL ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			if (st[i][j])continue;
			f[i][j] = min(min(f[i - 1][j], f[i][j - 1]), f[i - 1][j - 1]) + 1;
			ans += f[i][j];
		}
	}
	cout << ans << endl;
	return 0;
}